package Future;

import java.util.concurrent.Callable;

public class CallableDemos   implements Callable<String>{
	
	public void sendMails(){
		try {
			System.out.println("开始发送邮件");
			Thread.sleep(1000);
			System.out.println("完成发送邮件");
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
	
	public CallableDemos(String contents) {
		this.contents = contents;
	}
	String contents;
	public String call() throws Exception {
		 sendMails();
		return contents;
	}
	
	
	
}
